# $Id$
# Maintainer:  Ionut Biru <ibiru@archlinux.org>
# Contributor: William Díaz <wdiaz@archlinux.us>

pkgname=libnice
pkgver=0.1.14
pkgrel=1
pkgdesc="An implementation of the IETF's draft ICE (for p2p UDP data streams)"
arch=('i686' 'x86_64')
url="https://nice.freedesktop.org"
license=('LGPL')
depends=('glib2' 'gnutls')
makedepends=('gstreamer' 'gtk-doc' 'git')
optdepends=('gstreamer')
_commit=6bfea0d063fb358a44e8800eae314520a2babd61  # tags/0.1.14^0
source=("git+https://anongit.freedesktop.org/git/libnice/libnice#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  ./configure --prefix=/usr --disable-static --with-gstreamer-0.10=no --enable-gtk-doc

  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

  make
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
}
